using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;
using NetProtocol.Client;
using NetProtocol.POD;

namespace IQIGame.Onigao.GamePlay
{
    public class MailModule : Singleton<MailModule>, CNetMail
    {
        private MailModule() { }

        public void InitModule(PlayerPOD playerPOD)
        {
            GameDataCenter.PlayerData.newMailCount = playerPOD.newMailCount;
        }

        public void ClearModule()
        {
            GameDataCenter.PlayerData.newMailCount = 0;
        }

        #region Net层
        public static CNetMail NetCore => Instance;

        ISession CNetMail.GetSession()
        {
            return GameServerModule.Instance.CurrSession;
        }

        void CNetMail.SC_notifyNewMail(ISession session, int newMailCount)
        {
            GameDataCenter.PlayerData.newMailCount = newMailCount;
        }
        #endregion

    }
}
